<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>Command-module for Audacity, an audio-editing application &mdash; Dragonfly-modules v0.1 documentation</title>
    <link rel="stylesheet" href="_static/default.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '',
        VERSION:     '0.1',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="top" title="Dragonfly-modules v0.1 documentation" href="index.html" />
    <link rel="next" title="Module source code" href="mod-notepad_foodgroups.html" />
    <link rel="prev" title="Command-module for SharpReader feed aggregator" href="mod-sharpreader.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="mod-notepad_foodgroups.html" title="Module source code"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="mod-sharpreader.html" title="Command-module for SharpReader feed aggregator"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Dragonfly-modules v0.1 documentation</a> &raquo;</li> 
      </ul>
    </div>  
    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  
  <div class="section" id="command-module-for-audacity-an-audio-editing-application">
<h1>Command-module for <strong>Audacity</strong>, an audio-editing application<a class="headerlink" href="#command-module-for-audacity-an-audio-editing-application" title="Permalink to this headline">¶</a></h1>
<p>This module offers voice-commands to control
<a class="reference external" href="http://audacity.sourceforge.net/">Audacity</a>, an open
source application for recording and editing sounds.</p>
<div class="section" id="customization">
<h2>Customization<a class="headerlink" href="#customization" title="Permalink to this headline">¶</a></h2>
<p>Users can edit the spoken-form of this module&#8217;s commands
in its configuration file.  This is useful for
translations, for example.</p>
</div>
<div class="section" id="configuration-examples">
<h2>Configuration examples<a class="headerlink" href="#configuration-examples" title="Permalink to this headline">¶</a></h2>
<div class="section" id="configuration-audacity-en-txt">
<h3>Configuration &#8220;_audacity-en.txt&#8221;<a class="headerlink" href="#configuration-audacity-en-txt" title="Permalink to this headline">¶</a></h3>
<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><pre>  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166</pre></td><td class="code"><div class="highlight"><pre><span class="c">#</span>
<span class="c"># Dragonfly config for Audacity control</span>
<span class="c">#</span>


<span class="c">#--- Language section ------------------------------------------------------</span>

<span class="c"># Spec starts a new project.</span>
<span class="c"># Default: &#39;[start] new project&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">new_project</span> <span class="o">=</span> <span class="s">&#39;[start] new project&#39;</span>

<span class="c"># Spec opens an existing project.</span>
<span class="c"># Default: &#39;open project&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">open_project</span> <span class="o">=</span> <span class="s">&#39;open project&#39;</span>

<span class="c"># Spec closes currently open project.</span>
<span class="c"># Default: &#39;close [this] project&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">close_project</span> <span class="o">=</span> <span class="s">&#39;close [this] project&#39;</span>

<span class="c"># Spec saves currently open project.</span>
<span class="c"># Default: &#39;save [this] project&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">save_project</span> <span class="o">=</span> <span class="s">&#39;save [this] project&#39;</span>

<span class="c"># Spec opens the selection tool.</span>
<span class="c"># Default: &#39;[open] selection tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">save_project</span> <span class="o">=</span> <span class="s">&#39;[open] selection tool&#39;</span>

<span class="c"># Spec opens the envelope tool.</span>
<span class="c"># Default: &#39;[open] envelope tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">envelope_tool</span> <span class="o">=</span> <span class="s">&#39;[open] envelope tool&#39;</span>

<span class="c"># Spec opens the edit tool.</span>
<span class="c"># Default: &#39;[open] edit tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">edit_tool</span> <span class="o">=</span> <span class="s">&#39;[open] edit tool&#39;</span>

<span class="c"># Spec opens the zoom tool.</span>
<span class="c"># Default: &#39;[open] zoom tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">zoom_tool</span> <span class="o">=</span> <span class="s">&#39;[open] zoom tool&#39;</span>

<span class="c"># Spec opens the timeshift tool.</span>
<span class="c"># Default: &#39;[open] timeshift tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">timeshift_tool</span> <span class="o">=</span> <span class="s">&#39;[open] timeshift tool&#39;</span>

<span class="c"># Spec opens the multitool.</span>
<span class="c"># Default: &#39;[open] multi tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">multi_tool</span> <span class="o">=</span> <span class="s">&#39;[open] multi tool&#39;</span>

<span class="c"># Spec move to the next tool in toolbar.</span>
<span class="c"># Default: &#39;[move to | go to] next tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">next_toolbar_tool</span> <span class="o">=</span> <span class="s">&#39;[move to | go to] next tool&#39;</span>

<span class="c"># Spec move to the previous tool in toolbar.</span>
<span class="c"># Default: &#39;[move to | go to] previous tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">previous_toolbar_tool</span> <span class="o">=</span> <span class="s">&#39;[move to | go to] previous tool&#39;</span>

<span class="c"># Spec insert silence at current position.</span>
<span class="c"># Default: &#39;[insert | create] silence&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">silence</span> <span class="o">=</span> <span class="s">&#39;[insert | create] silence&#39;</span>

<span class="c"># Spec makes duplicate.</span>
<span class="c"># Default: &#39;[make] duplicate&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">duplicate</span> <span class="o">=</span> <span class="s">&#39;[make] duplicate&#39;</span>

<span class="c"># Spec finds zero crossings.</span>
<span class="c"># Default: &#39;[find | search] zero crossings&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">find_zero_crossings</span> <span class="o">=</span> <span class="s">&#39;[find | search] zero crossings&#39;</span>

<span class="c"># Spec starts or stops playback.</span>
<span class="c"># Default: &#39;[start | stop] playing&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">play_stop</span> <span class="o">=</span> <span class="s">&#39;[start | stop] playing&#39;</span>

<span class="c"># Spec starts a loop.</span>
<span class="c"># Default: &#39;[start] loop&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">loop</span> <span class="o">=</span> <span class="s">&#39;[start] loop&#39;</span>

<span class="c"># Spec pauses current playback or recording.</span>
<span class="c"># Default: &#39;pause [playback | recording]&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">pause</span> <span class="o">=</span> <span class="s">&#39;pause [playback | recording]&#39;</span>

<span class="c"># Spec starts recording.</span>
<span class="c"># Default: &#39;[start | begin] recording&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">record</span> <span class="o">=</span> <span class="s">&#39;[start | begin] recording&#39;</span>

<span class="c"># Spec plays one second at cursor position.</span>
<span class="c"># Default: &#39;[play] cursor selection&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">play_cursor_selection</span> <span class="o">=</span> <span class="s">&#39;[play] cursor selection&#39;</span>

<span class="c"># Spec zooms in on current view.</span>
<span class="c"># Default: &#39;zoom in&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">zoom_in</span> <span class="o">=</span> <span class="s">&#39;zoom in&#39;</span>

<span class="c"># Spec zoom in or out to standard zoom level.</span>
<span class="c"># Default: &#39;[return to] standard zoom level&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">zoom_normal</span> <span class="o">=</span> <span class="s">&#39;[return to] standard zoom level&#39;</span>

<span class="c"># Spec zooms out on current view.</span>
<span class="c"># Default: &#39;zoom out&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">zoom_out</span> <span class="o">=</span> <span class="s">&#39;zoom out&#39;</span>

<span class="c"># Spec fits the track in current window size.</span>
<span class="c"># Default: &#39;fit [track] to window&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">fit_window</span> <span class="o">=</span> <span class="s">&#39;fit [track] to window&#39;</span>

<span class="c"># Spec makes all tracks visible in current window size.</span>
<span class="c"># Default: &#39;fit all tracks [to window]&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">fit_vertically</span> <span class="o">=</span> <span class="s">&#39;fit all tracks [to window]&#39;</span>

<span class="c"># Spec zooms in on your current selection.</span>
<span class="c"># Default: &#39;zoom [in] selection&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">zoom_selection</span> <span class="o">=</span> <span class="s">&#39;zoom [in] selection&#39;</span>

<span class="c"># Spec imports audio from your PC.</span>
<span class="c"># Default: &#39;import audio&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">import_audio</span> <span class="o">=</span> <span class="s">&#39;import audio&#39;</span>

<span class="c"># Spec creates a label.</span>
<span class="c"># Default: &#39;[create | make] label&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">create_label</span> <span class="o">=</span> <span class="s">&#39;[create | make] label&#39;</span>

<span class="c"># Spec repeats the last effect.</span>
<span class="c"># Default: &#39;repeat last effect&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">repeat_last_effect</span> <span class="o">=</span> <span class="s">&#39;repeat last effect&#39;</span>

<span class="c"># Spec deletes current selection and removes empty space.</span>
<span class="c"># Default: &#39;ripple delete selection&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">ripple_delete</span> <span class="o">=</span> <span class="s">&#39;ripple delete selection&#39;</span>

<span class="c"># Spec deletes current selection while leaving space empty.</span>
<span class="c"># Default:&#39;split delete selection&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">split_delete</span> <span class="o">=</span> <span class="s">&#39;split delete selection&#39;</span>

<span class="c"># Spec splits new.</span>
<span class="c"># Default: &#39;split new&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">split_new</span> <span class="o">=</span> <span class="s">&#39;split new&#39;</span>

<span class="c"># Spec removes all empty spaces from track.</span>
<span class="c"># Default: &#39;join track&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">join</span> <span class="o">=</span> <span class="s">&#39;join track&#39;</span>

<span class="c"># Spec brings back empty spaces in track.</span>
<span class="c"># Default:  &#39;disjoin track&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">disjoin</span> <span class="o">=</span> <span class="s">&#39;disjoin track&#39;</span>

<span class="c"># Spec mutes all tracks in file.</span>
<span class="c"># Default: &#39;mute all [tracks]&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">mute_all_tracks</span><span class="o">=</span> <span class="s">&#39;lang.mute_all_tracks&#39;</span>

<span class="c"># Spec unmutes all tracks in file.</span>
<span class="c"># Default: &#39;mute all [tracks]&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">unmute_all_tracks</span> <span class="o">=</span> <span class="s">&#39;mute all [tracks]&#39;</span>

<span class="c"># Spec collapses all tracks in file.</span>
<span class="c"># Default: &#39;collapse all [tracks]&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">collapse_all_tracks</span> <span class="o">=</span> <span class="n">lang</span><span class="o">.</span><span class="n">collapse_all_tracks</span>

<span class="c"># Spec expands all tracks in file.</span>
<span class="c"># Default: &#39;expand all [tracks]&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">expand_all_tracks</span> <span class="o">=</span> <span class="s">&#39;expand_all_tracks&#39;</span>

<span class="c"># Spec exports track to preferred file format.</span>
<span class="c"># Default : &#39;export track&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">expand_all_tracks</span> <span class="o">=</span> <span class="s">&#39;export track&#39;</span>

<span class="c"># Spec exports selection to preferred file format.</span>
<span class="c"># Default : &#39;export selection&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">export_track</span> <span class="o">=</span> <span class="s">&#39;export selection&#39;</span>
</pre></div>
</td></tr></table></div>
</div>
<div class="section" id="configuration-audacity-nl-txt">
<h3>Configuration &#8220;_audacity-nl.txt&#8221;<a class="headerlink" href="#configuration-audacity-nl-txt" title="Permalink to this headline">¶</a></h3>
<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><pre>  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166</pre></td><td class="code"><div class="highlight"><pre><span class="c">#</span>
<span class="c"># Dragonfly config for Audacity control</span>
<span class="c">#</span>


<span class="c">#--- Language section ------------------------------------------------------</span>

<span class="c"># Spec starts a new project.</span>
<span class="c"># Default: &#39;[start] new project&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">new_project</span> <span class="o">=</span> <span class="s">&#39;[start] nieuw project&#39;</span>

<span class="c"># Spec opens an existing project.</span>
<span class="c"># Default: &#39;open project&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">open_project</span> <span class="o">=</span> <span class="s">&#39;open project&#39;</span>

<span class="c"># Spec closes currently open project.</span>
<span class="c"># Default: &#39;close [this] project&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">close_project</span> <span class="o">=</span> <span class="s">&#39;sluit [dit] project&#39;</span>

<span class="c"># Spec saves currently open project.</span>
<span class="c"># Default: &#39;save [this] project&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">save_project</span> <span class="o">=</span> <span class="s">&#39;bewaar [dit] project&#39;</span>

<span class="c"># Spec opens the selection tool.</span>
<span class="c"># Default: &#39;[open] selection tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">save_project</span> <span class="o">=</span> <span class="s">&#39;[open] selectie tool&#39;</span>

<span class="c"># Spec opens the envelope tool.</span>
<span class="c"># Default: &#39;[open] envelope tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">envelope_tool</span> <span class="o">=</span> <span class="s">&#39;[open] envelope tool&#39;</span>

<span class="c"># Spec opens the edit tool.</span>
<span class="c"># Default: &#39;[open] edit tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">edit_tool</span> <span class="o">=</span> <span class="s">&#39;[open] edit tool&#39;</span>

<span class="c"># Spec opens the zoom tool.</span>
<span class="c"># Default: &#39;[open] zoom tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">zoom_tool</span> <span class="o">=</span> <span class="s">&#39;[open] zoom tool&#39;</span>

<span class="c"># Spec opens the timeshift tool.</span>
<span class="c"># Default: &#39;[open] timeshift tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">timeshift_tool</span> <span class="o">=</span> <span class="s">&#39;[open] timeshift tool&#39;</span>

<span class="c"># Spec opens the multitool.</span>
<span class="c"># Default: &#39;[open] multi tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">multi_tool</span> <span class="o">=</span> <span class="s">&#39;[open] multi tool&#39;</span>

<span class="c"># Spec move to the next tool in toolbar.</span>
<span class="c"># Default: &#39;[move to | go to] next tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">next_toolbar_tool</span> <span class="o">=</span> <span class="s">&#39;[ga naar] volgende tool&#39;</span>

<span class="c"># Spec move to the previous tool in toolbar.</span>
<span class="c"># Default: &#39;[move to | go to] previous tool&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">previous_toolbar_tool</span> <span class="o">=</span> <span class="s">&#39;[ga naar] vorige tool&#39;</span>

<span class="c"># Spec insert silence at current position.</span>
<span class="c"># Default: &#39;[insert | create] silence&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">silence</span> <span class="o">=</span> <span class="s">&#39;[maak] stilte&#39;</span>

<span class="c"># Spec makes duplicate.</span>
<span class="c"># Default: &#39;[make] duplicate&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">duplicate</span> <span class="o">=</span> <span class="s">&#39;[maak] duplicaat&#39;</span>

<span class="c"># Spec finds zero crossings.</span>
<span class="c"># Default: &#39;[find | search] zero crossings&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">find_zero_crossings</span> <span class="o">=</span> <span class="s">&#39;[vind | zoek] zero kruisingen&#39;</span>

<span class="c"># Spec starts or stops playback.</span>
<span class="c"># Default: &#39;[start | stop] playing&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">play_stop</span> <span class="o">=</span> <span class="s">&#39;[start | stop] afspelen&#39;</span>

<span class="c"># Spec starts a loop.</span>
<span class="c"># Default: &#39;[start] loop&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">loop</span> <span class="o">=</span> <span class="s">&#39;[start] loop&#39;</span>

<span class="c"># Spec pauses current playback or recording.</span>
<span class="c"># Default: &#39;pause [playback | recording]&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">pause</span> <span class="o">=</span> <span class="s">&#39;pauzeer [afspelen | opname]&#39;</span>

<span class="c"># Spec starts recording.</span>
<span class="c"># Default: &#39;[start | begin] recording&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">record</span> <span class="o">=</span> <span class="s">&#39;[start | begin] opname&#39;</span>

<span class="c"># Spec plays one second at cursor position.</span>
<span class="c"># Default: &#39;[play] cursor selection&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">play_cursor_selection</span> <span class="o">=</span> <span class="s">&#39;[speel] cursor punt&#39;</span>

<span class="c"># Spec zooms in on current view.</span>
<span class="c"># Default: &#39;zoom in&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">zoom_in</span> <span class="o">=</span> <span class="s">&#39;zoom in&#39;</span>

<span class="c"># Spec zoom in or out to standard zoom level.</span>
<span class="c"># Default: &#39;[return to] standard zoom level&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">zoom_normal</span> <span class="o">=</span> <span class="s">&#39;[ga terug] naar standaard zoom&#39;</span>

<span class="c"># Spec zooms out on current view.</span>
<span class="c"># Default: &#39;zoom out&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">zoom_out</span> <span class="o">=</span> <span class="s">&#39;zoom uit&#39;</span>

<span class="c"># Spec fits the track in current window size.</span>
<span class="c"># Default: &#39;fit [track] to window&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">fit_window</span> <span class="o">=</span> <span class="s">&#39;[maak] passend in venster&#39;</span>

<span class="c"># Spec makes all tracks visible in current window size.</span>
<span class="c"># Default: &#39;fit all tracks [to window]&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">fit_vertically</span> <span class="o">=</span> <span class="s">&#39;laat alle tracks [in venster] zien&#39;</span>

<span class="c"># Spec zooms in on your current selection.</span>
<span class="c"># Default: &#39;zoom [in] selection&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">zoom_selection</span> <span class="o">=</span> <span class="s">&#39;zoom [in] op selectie&#39;</span>

<span class="c"># Spec imports audio from your PC.</span>
<span class="c"># Default: &#39;import audio&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">import_audio</span> <span class="o">=</span> <span class="s">&#39;importeer audio&#39;</span>

<span class="c"># Spec creates a label.</span>
<span class="c"># Default: &#39;[create | make] label&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">create_label</span> <span class="o">=</span> <span class="s">&#39;[create | make] label&#39;</span>

<span class="c"># Spec repeats the last effect.</span>
<span class="c"># Default: &#39;repeat last effect&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">repeat_last_effect</span> <span class="o">=</span> <span class="s">&#39;repeat last effect&#39;</span>

<span class="c"># Spec deletes current selection and removes empty space.</span>
<span class="c"># Default: &#39;ripple delete selection&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">ripple_delete</span> <span class="o">=</span> <span class="s">&#39;ripple delete selection&#39;</span>

<span class="c"># Spec deletes current selection while leaving space empty.</span>
<span class="c"># Default:&#39;split delete selection&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">split_delete</span> <span class="o">=</span> <span class="s">&#39;split delete selection&#39;</span>

<span class="c"># Spec splits new.</span>
<span class="c"># Default: &#39;split new&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">split_new</span> <span class="o">=</span> <span class="s">&#39;split new&#39;</span>

<span class="c"># Spec removes all empty spaces from track.</span>
<span class="c"># Default: &#39;join track&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">join</span> <span class="o">=</span> <span class="s">&#39;join track&#39;</span>

<span class="c"># Spec brings back empty spaces in track.</span>
<span class="c"># Default:  &#39;disjoin track&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">disjoin</span> <span class="o">=</span> <span class="s">&#39;disjoin track&#39;</span>

<span class="c"># Spec mutes all tracks in file.</span>
<span class="c"># Default: &#39;mute all [tracks]&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">mute_all_tracks</span><span class="o">=</span> <span class="s">&#39;mute all [tracks]&#39;</span>

<span class="c"># Spec unmutes all tracks in file.</span>
<span class="c"># Default: &#39;mute all [tracks]&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">unmute_all_tracks</span> <span class="o">=</span> <span class="s">&#39;mute all [tracks]&#39;</span>

<span class="c"># Spec collapses all tracks in file.</span>
<span class="c"># Default: &#39;collapse all [tracks]&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">collapse_all_tracks</span> <span class="o">=</span> <span class="s">&#39;collapse all [tracks]&#39;</span>

<span class="c"># Spec expands all tracks in file.</span>
<span class="c"># Default: &#39;expand all [tracks]&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">expand_all_tracks</span> <span class="o">=</span> <span class="s">&#39;expand_all_tracks&#39;</span>

<span class="c"># Spec exports track to preferred file format.</span>
<span class="c"># Default : &#39;export track&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">expand_all_tracks</span> <span class="o">=</span> <span class="s">&#39;export track&#39;</span>

<span class="c"># Spec exports selection to preferred file format.</span>
<span class="c"># Default : &#39;export selection&#39;</span>
<span class="n">lang</span><span class="o">.</span><span class="n">export_track</span> <span class="o">=</span> <span class="s">&#39;export selection&#39;</span>
</pre></div>
</td></tr></table></div>
</div>
</div>
<div class="section" id="module-source-code">
<h2>Module source code<a class="headerlink" href="#module-source-code" title="Permalink to this headline">¶</a></h2>
<p>The most current version of this module can be downloaded from the <a class="reference external" href="http://dragonfly-modules.googlecode.com/svn/trunk/command-modules/_audacity.py">repository here</a>.</p>
<div class="highlight-python"><table class="highlighttable"><tr><td class="linenos"><pre>  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153</pre></td><td class="code"><div class="highlight"><pre><span class="c">#</span>
<span class="c"># This file is a command-module for Dragonfly.</span>
<span class="c"># (c) Copyright 2008 by Biddy</span>
<span class="c"># Licensed under the LGPL, see &lt;http://www.gnu.org/licenses/&gt;</span>
<span class="c">#</span>

<span class="sd">&quot;&quot;&quot;</span>
<span class="sd">Command-module for **Audacity**, an audio-editing application</span>
<span class="sd">=============================================================</span>
<span class="sd">This module offers voice-commands to control</span>
<span class="sd">`Audacity &lt;http://audacity.sourceforge.net/&gt;`_, an open</span>
<span class="sd">source application for recording and editing sounds.</span>

<span class="sd">Customization</span>
<span class="sd">-------------</span>
<span class="sd">Users can edit the spoken-form of this module&#39;s commands</span>
<span class="sd">in its configuration file.  This is useful for</span>
<span class="sd">translations, for example.</span>

<span class="sd">&quot;&quot;&quot;</span>

<span class="kn">import</span> <span class="nn">pkg_resources</span>
<span class="n">pkg_resources</span><span class="o">.</span><span class="n">require</span><span class="p">(</span><span class="s">&quot;dragonfly &gt;= 0.6.5beta1.dev-r76&quot;</span><span class="p">)</span>

<span class="kn">from</span> <span class="nn">dragonfly</span> <span class="kn">import</span> <span class="p">(</span><span class="n">Grammar</span><span class="p">,</span> <span class="n">AppContext</span><span class="p">,</span> <span class="n">MappingRule</span><span class="p">,</span> <span class="n">Key</span><span class="p">,</span>
                       <span class="n">Config</span><span class="p">,</span> <span class="n">Section</span><span class="p">,</span> <span class="n">Item</span><span class="p">)</span>


<span class="c">#---------------------------------------------------------------------------</span>
<span class="c"># Initialize this module&#39;s configuration.</span>

<span class="n">config</span> <span class="o">=</span> <span class="n">Config</span><span class="p">(</span><span class="s">&quot;Audacity control&quot;</span><span class="p">)</span>

<span class="n">config</span><span class="o">.</span><span class="n">lang</span>                    <span class="o">=</span> <span class="n">Section</span><span class="p">(</span><span class="s">&quot;Language section&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">new_project</span>        <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[start] new project&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec starts a new project.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">open_project</span>       <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;open project&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec opens an existing project.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">close_project</span>      <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;close [this] project&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec closes currently open project.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">save_project</span>       <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;save [this] project&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec saves currently open project.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">selection_tool</span>     <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[open] selection tool&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec opens the selection tool.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">envelope_tool</span>      <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[open] envelope tool&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec opens the envelope tool.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">edit_tool</span>          <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[open] edit tool&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec opens the edit tool.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">zoom_tool</span>          <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[open] zoom tool&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec opens the zoom tool.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">timeshift_tool</span>     <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[open] timeshift tool&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec opens the timeshift tool.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">multi_tool</span>         <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[open] multi tool&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec opens the multitool.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">next_toolbar_tool</span>  <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[move to | go to] next tool&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec move to the next tool in toolbar.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">previous_toolbar_tool</span> <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[move to | go to] previous tool&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec move to the previous tool in toolbar.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">silence</span>            <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[insert | create] silence&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec insert silence at current position.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">duplicate</span>          <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[make] duplicate&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec makes duplicate.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">find_zero_crossings</span><span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[find | search] zero crossings&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec finds zero crossings.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">play_stop</span>          <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[start | stop] playing&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec starts or stops playback.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">loop</span>               <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[start] loop&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec starts a loop.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">pause</span>              <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;pause [playback | recording]&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec pauses current playback or recording.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">record</span>             <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[start | begin] recording&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec starts recording.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">play_cursor_selection</span> <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[play] cursor selection&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec plays one second at cursor position.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">zoom_in</span>            <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;zoom in&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec zooms in on current view.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">zoom_normal</span>        <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[return to] standard zoom level&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec zoom in or out to standard zoom level.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">zoom_out</span>           <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;zoom out&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec zooms out on current view.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">fit_window</span>         <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;fit [track] to window&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec fits the track in current window size.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">fit_vertically</span>     <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;fit all tracks [to window]&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec makes all tracks visible in current window size.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">zoom_selection</span>     <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;zoom [in] selection&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec zooms in on your current selection.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">import_audio</span>       <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;import audio&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec imports audio from your PC.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">create_label</span>       <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;[create | make] label&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec creates a label.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">repeat_last_effect</span> <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;repeat last effect&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec repeats the last effect.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">ripple_delete</span>      <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;ripple delete selection&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec deletes current selection and removes empty space.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">split_delete</span>       <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;split delete selection&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec deletes current selection while leaving space empty.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">split_new</span>          <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;split new&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec splits new.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">join</span>               <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;join track&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec removes all empty spaces from track.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">disjoin</span>            <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;disjoin track&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec brings back empty spaces in track.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">mute_all_tracks</span>    <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;mute all [tracks]&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec mutes all tracks in file.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">unmute_all_tracks</span>  <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;unmute all [tracks]&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec unmutes all tracks in file.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">collapse_all_tracks</span><span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;collapse all [tracks]&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec collapses all tracks in file.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">expand_all_tracks</span>  <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;expand all [tracks]&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec expands all tracks in file.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">export_track</span>       <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;export track&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec exports track to preferred file format.&quot;</span><span class="p">)</span>
<span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">export_selection</span>   <span class="o">=</span> <span class="n">Item</span><span class="p">(</span><span class="s">&quot;export selection&quot;</span><span class="p">,</span> <span class="n">doc</span><span class="o">=</span><span class="s">&quot;Spec exports selection to preferred file format.&quot;</span><span class="p">)</span>

<span class="c">#config.generate_config_file()</span>
<span class="n">config</span><span class="o">.</span><span class="n">load</span><span class="p">()</span>


<span class="c">#---------------------------------------------------------------------------</span>
<span class="c"># Create this module&#39;s grammar and the context under which it&#39;ll be active.</span>

<span class="n">context</span> <span class="o">=</span> <span class="n">AppContext</span><span class="p">(</span><span class="n">executable</span><span class="o">=</span><span class="s">&quot;audacity&quot;</span><span class="p">)</span>
<span class="n">grammar</span> <span class="o">=</span> <span class="n">Grammar</span><span class="p">(</span><span class="s">&quot;audacity&quot;</span><span class="p">,</span> <span class="n">context</span><span class="o">=</span><span class="n">context</span><span class="p">)</span>


<span class="c">#---------------------------------------------------------------------------</span>
<span class="c"># This module&#39;s main keystroke mapping rule.</span>

<span class="n">keystrokes_rule</span> <span class="o">=</span> <span class="n">MappingRule</span><span class="p">(</span>
    <span class="n">name</span><span class="o">=</span><span class="s">&quot;keystrokes&quot;</span><span class="p">,</span>
    <span class="n">mapping</span><span class="o">=</span><span class="p">{</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">new_project</span><span class="p">:</span>            <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-n&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">open_project</span><span class="p">:</span>           <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-o&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">close_project</span><span class="p">:</span>          <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-w&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">save_project</span><span class="p">:</span>           <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-s&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">selection_tool</span><span class="p">:</span>         <span class="n">Key</span><span class="p">(</span><span class="s">&quot;f1&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">envelope_tool</span><span class="p">:</span>          <span class="n">Key</span><span class="p">(</span><span class="s">&quot;f2&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">edit_tool</span><span class="p">:</span>              <span class="n">Key</span><span class="p">(</span><span class="s">&quot;f3&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">zoom_tool</span><span class="p">:</span>              <span class="n">Key</span><span class="p">(</span><span class="s">&quot;f4&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">timeshift_tool</span><span class="p">:</span>         <span class="n">Key</span><span class="p">(</span><span class="s">&quot;f5&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">multi_tool</span><span class="p">:</span>             <span class="n">Key</span><span class="p">(</span><span class="s">&quot;f6&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">next_toolbar_tool</span><span class="p">:</span>      <span class="n">Key</span><span class="p">(</span><span class="s">&quot;d&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">previous_toolbar_tool</span><span class="p">:</span>  <span class="n">Key</span><span class="p">(</span><span class="s">&quot;a&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">silence</span><span class="p">:</span>                <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-l&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">duplicate</span><span class="p">:</span>              <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-d&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">find_zero_crossings</span><span class="p">:</span>    <span class="n">Key</span><span class="p">(</span><span class="s">&quot;z&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">play_stop</span><span class="p">:</span>              <span class="n">Key</span><span class="p">(</span><span class="s">&quot;space&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">loop</span><span class="p">:</span>                   <span class="n">Key</span><span class="p">(</span><span class="s">&quot;l&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">pause</span><span class="p">:</span>                  <span class="n">Key</span><span class="p">(</span><span class="s">&quot;p&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">record</span><span class="p">:</span>                 <span class="n">Key</span><span class="p">(</span><span class="s">&quot;r&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">play_cursor_selection</span><span class="p">:</span>  <span class="n">Key</span><span class="p">(</span><span class="s">&quot;b&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">zoom_in</span><span class="p">:</span>                <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-1&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">zoom_normal</span><span class="p">:</span>            <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-2&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">zoom_out</span><span class="p">:</span>               <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-3&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">fit_window</span><span class="p">:</span>             <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-f&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">fit_vertically</span><span class="p">:</span>         <span class="n">Key</span><span class="p">(</span><span class="s">&quot;cs-f&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">zoom_selection</span><span class="p">:</span>         <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-e&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">import_audio</span><span class="p">:</span>           <span class="n">Key</span><span class="p">(</span><span class="s">&quot;cs-i&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">create_label</span><span class="p">:</span>           <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-b&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">repeat_last_effect</span><span class="p">:</span>     <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-r&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">ripple_delete</span><span class="p">:</span>          <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-k&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">split_delete</span><span class="p">:</span>           <span class="n">Key</span><span class="p">(</span><span class="s">&quot;ca-k&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">split_new</span><span class="p">:</span>              <span class="n">Key</span><span class="p">(</span><span class="s">&quot;ca-i&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">join</span><span class="p">:</span>                   <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-j&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">disjoin</span><span class="p">:</span>                <span class="n">Key</span><span class="p">(</span><span class="s">&quot;ca-j&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">mute_all_tracks</span><span class="p">:</span>        <span class="n">Key</span><span class="p">(</span><span class="s">&quot;c-u&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">unmute_all_tracks</span><span class="p">:</span>      <span class="n">Key</span><span class="p">(</span><span class="s">&quot;cs-u&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">collapse_all_tracks</span><span class="p">:</span>    <span class="n">Key</span><span class="p">(</span><span class="s">&quot;cs-c&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">expand_all_tracks</span><span class="p">:</span>      <span class="n">Key</span><span class="p">(</span><span class="s">&quot;cs-x&quot;</span><span class="p">),</span>

             <span class="c"># Customised hotkeys.</span>
             <span class="c"># (editable in Audacity; Preferences; Keyboard)</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">export_track</span><span class="p">:</span>           <span class="n">Key</span><span class="p">(</span><span class="s">&quot;ca-e&quot;</span><span class="p">),</span>
             <span class="n">config</span><span class="o">.</span><span class="n">lang</span><span class="o">.</span><span class="n">export_selection</span><span class="p">:</span>       <span class="n">Key</span><span class="p">(</span><span class="s">&quot;cs-e&quot;</span><span class="p">),</span>
            <span class="p">},</span>
    <span class="p">)</span>

<span class="c"># Add the action rule to the grammar instance.</span>
<span class="n">grammar</span><span class="o">.</span><span class="n">add_rule</span><span class="p">(</span><span class="n">keystrokes_rule</span><span class="p">)</span>



<span class="c">#---------------------------------------------------------------------------</span>
<span class="c"># Load the grammar instance and define how to unload it.</span>

<span class="n">grammar</span><span class="o">.</span><span class="n">load</span><span class="p">()</span>

<span class="c"># Unload function which will be called by natlink at unload time.</span>
<span class="k">def</span> <span class="nf">unload</span><span class="p">():</span>
    <span class="k">global</span> <span class="n">grammar</span>
    <span class="k">if</span> <span class="n">grammar</span><span class="p">:</span> <span class="n">grammar</span><span class="o">.</span><span class="n">unload</span><span class="p">()</span>
    <span class="n">grammar</span> <span class="o">=</span> <span class="bp">None</span>
</pre></div>
</td></tr></table></div>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="">Command-module for <strong>Audacity</strong>, an audio-editing application</a><ul>
<li><a class="reference external" href="#customization">Customization</a></li>
<li><a class="reference external" href="#configuration-examples">Configuration examples</a><ul>
<li><a class="reference external" href="#configuration-audacity-en-txt">Configuration &#8220;_audacity-en.txt&#8221;</a></li>
<li><a class="reference external" href="#configuration-audacity-nl-txt">Configuration &#8220;_audacity-nl.txt&#8221;</a></li>
</ul>
</li>
<li><a class="reference external" href="#module-source-code">Module source code</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="mod-sharpreader.html" title="previous chapter">Command-module for <strong>SharpReader</strong> feed aggregator</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="mod-notepad_foodgroups.html" title="next chapter">Module source code</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="_sources/mod-_audacity.txt">Show Source</a></li>
            </ul>
          <h3>Quick search</h3>
            <form class="search" action="search.html" method="get">
              <input type="text" name="q" size="18" /> <input type="submit" value="Go" />
              <input type="hidden" name="check_keywords" value="yes" />
              <input type="hidden" name="area" value="default" />
            </form>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="mod-notepad_foodgroups.html" title="Module source code"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="mod-sharpreader.html" title="Command-module for SharpReader feed aggregator"
             accesskey="P">previous</a> |</li>
        <li><a href="index.html">Dragonfly-modules v0.1 documentation</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
      &copy; Copyright 2008, Christo Butcher.
      Last updated on Apr 10, 2009.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.5.1.
    </div>
  </body>
</html>